<?php

namespace Database\Seeders;

use App\Models\Administrator;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class GenerateUserSeeder extends Seeder
{
    const DATA = [
        ['黄淑芬', '6060'],
        ['刘韩妤昕', '6422'],
        ['董雯雯', '6448'],
        ['李新', '6558'],
        ['秦苗', '6561'],
        ['张青青', '6622'],
        ['王肖男', '6631'],
        ['黄嘉华', '6654'],
        ['原章伟', '6680'],
        ['吴曼', '6682'],
        ['陈礼娜', '6695'],
        ['李聪', '6722'],
        ['马阳', '6727'],
        ['顾新旭', '6729'],
        ['朱跃', '6730'],
        ['周梅', '6766'],
        ['高晓玲', '6769'],
        ['王雯', '6777'],
        ['任萌', '6780'],
        ['李敏敏', '6782'],
        ['赵文艳', '6783'],
        ['吴兴艳', '6785'],
        ['王静', '6788'],
        ['苗羽婷', '6789'],
        ['林林', '6797'],
        ['朱瑜瑜', '6798'],
        ['刘喜梅', '6799'],
        ['高瑞', '6801'],
        ['王晶晶', '6802'],
        ['刘冰清', '6803'],
        ['王海瑞', '6911'],
        ['李静', '8042'],
        ['赵晓彤', '8230'],
        ['韩美汀', '9001'],
        ['乔雪', '9002'],
        ['李国萍', '9003'],
        ['侯丽华', '9004'],
        ['孙育强', '9167'],
        ['楚皎皎', '9168'],
        ['曹燚', '9169'],
        ['贺瑶', '9170'],
        ['安娜', '9171'],
        ['黄敏妍', '9172'],
        ['袁文豪', '9173'],
        ['郝威', '9200'],
        ['王娜', '9601'],
        ['张愿玲', '9602'],
        ['王佳慧', '9603'],
        ['王晓玉', '9771'],
        ['李静', '9801'],
        ['翟程林', '9882'],
        ['仇莎', '9885'],
        ['杨花', '9890'],
        ['田禾', '9891'],
        ['范丽妙', '9893'],
        ['刘义德', '9991'],
    ];

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach (self::DATA as $item) {
            $name = $item[0];
            $code = $item[1];

            $user = Administrator::updateOrCreate([
                'username' => $code,
            ], [
                'name' => $name,
                'crm_username' => $code,
                'password' => bcrypt('123456'),
            ]);
            $user->roles()->sync([2, 3]);

        }
    }
}
